Edit Declarations

Declarations are edited in the signal table or in the General section of the Declaration Editor .

Signal table and 'General section' of the Declaration Editor

Select multiple signals in the signal table to apply changes to them simultaneously.

Click Undo last operation or press Ctrl+Z to undo the last change.

Press ESC to cancel editing.

Signal type

A signal can be either a channel, a parameter, a constant, a measurement, or an assessment variable, see Signal Types. The signal type can be changed at any time.

Changing the signal type removes the signal and creates a new signal with the same name and properties (value, description and so on). You are warned when your test cases or assesslets are trying to find the removed signal. It's best to first use the global search to find all places where the signal to be removed is used, see Global Search, and then make a decision about changing the signal type.

Name

Signal names must be unique and composed of alphanumeric characters (A-Z, a-z, 0-9). They can use underscores "_". They cannot start with a number and cannot contain whitespaces. The following items may not be used in or as names:

keywords

exited, boolean, text, int8, uint8, int16, uint16, int32, uint32, int64, float, double, true, false, t, EMPTY, TPT, tpt_dataRecord, tpt_measuredRecord, during, result, char, int, abs, string, struct

mathematical
functions

acos, asin, atan, ceil, cos, exp, floor, log, max, min, pow, random, rint, sin, sqrt, tan, ...

All mathematical functions, see in TPT Modeling Language - Built-in Functions. Functions that can be used in the step list, see column "Step list", are not allowed as signal name.

assessment
keywords

and, assert, break, class, continue, def, del, elif, else, except, exec, finally, for, from, global, if, ...

All assessment keywords, see Test Assessment - Assessment Keywords.

Nevertheless, combinations are possible such as test_exited_01 or my_boolean.

Signal names can be copied by right-clicking on a signal in the signal table and by selecting Copy Name, or press Ctrl+ ALT+C. Use this feature for copying struct elements or signals with namespaces. You can paste them elsewhere in the project, for example in a step list or assesslet with the shortcut Ctrl+V.

Signals can be renamed. Select a signal name in the signal table to change its name. Multiple selection is possible. Select Tools|Rename Selected Signals to open the Rename Signals dialog. The Java syntax for regular expressions is used. By default, the expressions (.+) and $1 are set. In this way, for example, signals can be assigned to namespaces, see Figure " Rename signals to assigned them to namespaces, for example".

Use namespaces to organize components, to simplify the naming, or to avoid name conflicts, see TPT Modeling Language - Namespaces.

Rename signals to assigned them to namespaces, for example

Data type

TPT comes with predefined data types, such as uint8, int8, int16, uint32, int32, int64, float, double, boolean, string. Click in the Data type field and press Ctrl+Space to select a predefined data type from the drop-down list. You can also enter data types manually.

General section: Drop-down list of predefined data types

Custom data types as well as the predefined ones can also be selected and edited in the Type Editor, see Type Editor. Click the threedots button ".." Open Type Editor button. For more information about data types, see Data Types.

General section: Open the Type Editor

In the signal table, click in the Data type column to select a predefined or reusable data type from the drop-down list. Click Define custom type to define a data type for the signal in the Type Editor.

Signal table: D´drop-down list of predefined data types and 'Define custom type' list item

Data types of sub-elements from single-use data types are indented. You can change the sub-elements of an array[], curve{}, map{}, matrix[][], and struct{} in the Declaration Editor using the Data type drop-down list.

Data types of sub-elements from reusable data types can only be changed in the Type Editor. In the Declaration Editor, this is indicated by the gray color of the data type name of the sub-elements. For more information about reusable and single-use data types, see Type Editor.

Locked sub-elements of a reusable data type and editable sub-elements
of a single-use data type

Data types can be visually distinguished in the signal table.

Symbol Data type
+ {} struct
²+{} curve; a "2" is displayed as icon overlay that symbols the 2 dimensions of the curve
³+{} map; a "3" is displayed as icon overlay that symbols the 3 dimensions of the map

The dimension of the data type can also be recognized by the symbol.

Symbol Dimension
o scalar (dimension = 0)
[ ] array (dimension = 1)
[ ] [ ] matrix (dimension = 2)
[[..]] dimension >= 3

For example, when you create an array-of-structs the icon used is [{}].

Group

For filter and search purposes, it is possible to add a name in the Group field. Use the same group name for several signals, to group signals.

Unit

This text field takes an optional arbitrary unit name. When importing signals from A2L-files, this information is extracted automatically. Units are displayed in step lists and can be used for calculations, see Units.

To add a unit, select a unit name from the Unit drop-down list. Units can be created and customized in the Unit Editor, see Unit Editor. TPT can automatically convert units used in the step list.

Units cannot be set for structs, curves and maps.

When loading old files that had units defined in structs, curves or maps, these units will be passed on just to those elements that are one level down, provided they are not structs, curves or maps and do not have their own unit (if any existing, it will be kept). If the type of a signal is set to struct, curve or map, an existing unit is deleted.

Mode

The Mode drop-down list is only available for channels and parameters. A channel mode can be IN, OUT, LOCAL, or NONE, see Signal Types - Channel. A parameter can be of the mode READONLY, WRITEONLY, LOCAL, or EXCHANGE, see Signal Types - Parameter.

Record

This checkbox is applicable to channels, constants and assessment variables. If selected, the values of these signal types are logged during test execution no matter which execution platform is used. The checkbox is selected by default. Use this feature to reduce the size of the .tptbin file.

These signal types can also be logged for just one specific execution platform. Note that this logging overrides the settings done with this Record checkbox. For more information, see Mapping Flavor - Logging.
If you load TPT files older than TPT 12, this checkbox will be automatically selected for constants and system constants.

Value

The value entered here, serves as the default value. To edit any declaration value, alternatively click the three dots button "..." located in the right lower corner of the dialog to open the Value Editor. For more information, see Value Editor.

Only with integer data types it is possible to enter the value in the value field directly in a binary format; TPT will convert the binary value immediately to decimal. For example, typing 0b10001 in the value field will make TPT assign the value 17 to the corresponding declaration.

Description

When you add a description to a signal, this description is visible in the report, the Signal Viewer, and the Debug Signal Viewer.

If you also add a comment to a signal via the Script assesslet, the comment of the Script assesslet prevails in the report; to comment a signal in the Script assesslet, type <signal>.setComment("add you comment here").